-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Space Agon Demo from using Open Match 1 to Open Match 2 #51
Conversation
ab76c7d
to
cb2c632
Compare
install/helm/space-agon/values.yaml
Outdated
servicePort: 50502 | ||
image: | ||
repository: local/space-agon-mmf | ||
tag: TAG | ||
imagePullPolicy: IfNotPresent | ||
imagePullPolicy: Always | ||
ipAddress: 10.128.0.30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we deploy the space-agon on public cloud such as GKE, it is difficult to specify the ip address in advance.
Is this IP address used in the Open Match 2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed on GKE, by default the IP address is random. However, you can reserve an IP address for your GKE cluster and use that reserved IP address for the service. By doing so, the service will always be turned up with that specified IP address. I outlined the reasons and steps in the PR description as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction: it's not "reserve an IP address for your GKE cluster", it's "reserve an IP address in your vpc network" by going into "VPC Network" page on Pantheon UI, then "IP addresses" tab and then "RESERVE INTERNAL STATIC IP ADDRESS"
Sorry for being late. I'll check the changes. |
Thank you for this excellent PR! I've deployed it locally and verified it worked with Cloud Run. Open Match 2 seems to have increased dependencies on Google Cloud, such as Cloud Run, Memorystore for Redis, and Cloud IAM configuration. To enable integration tests on GitHub Actions and make the deployment simple, I'm considering deploying Open Match 2 Core and Redis on Kubernetes. If possible, could you merge the Kubernetes deployment version of Open Match 2 as the main code change and document the Cloud Run deployment as an optional method in such as DEPLOYMENT.md ? Since your current PR steps works as is, simply documenting these steps would be sufficient. |
@kemurayama Thanks so much for going through the steps, and I'm glad it worked! And yes, currently Open Match 2 indeed has a much stronger reliance on Google Cloud. This is a decision made by people including @joeholley in an effort to justify Open Match's product value to Google. I'm clearly aware that this change would mean less portability between different Clouds, which is one of the original goals of such an open sourced project. In fact, I've already had some discussions with my team, and have come to the conclusion that providing direct support for Kubernetes deployment is still vital to OM2. As a result, I'm planning to add the Kubernetes deployment version to in a coming PR. I decided to do this in a different PR because there will be some significant work involved to support Kubernetes. However, since the original design of OM2 was mostly around deploying through Cloud Run, I think it's still a good idea to merge this PR to the What do you think? |
Hi @peterzhongyi, Thanks !! I'm glad to know that OM2 also support Kubernetes in coming PRs. I'll merge this request. |
This pull request changes the Space Agon's match making logic from using Open Match 1 to Open Match 2(https://github.com/googleforgames/open-match2/blob/main)
Key files to review:
Key differences between OM1 and OM2:
omclient.go
andlogging.go
was created.Two tests are intentionally left out in the pull request:
omtest
tool anymore, and the test itself isn't originally covering a lot of the code logic either.To run the demo with this PR, first follow the README to until you installed Agones. Then instead of installing Open Match with
make openmatch-install
, follow the steps below to install OM2:docs/DEVELOPMENT.md
file to install OM2. You need to replace the IP address of theOM_REDIS_WRITE_HOST
andOM_REDIS_READ_HOST
in theservice.yaml
file to be the IP address of the Redis instance you created.Now to allow your
frontend
to talk to the OM2 you installed:Cloud Run Invoker
roleiam.gke.io/gcp-service-account
field infrontend.yaml
to be the Google Service Account you created.frontend.yaml
to the Google Service Account(in the form ofSERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
) withinstall/helm/space-agon/values.yaml
, change theomCoreAddress
field offrontend
to be the address of you OM2 service on Cloud Run.Because the MMF server are now called from Cloud Run instead of Kubernetes Cluster, the MMF needs to have an IP that the director needs to know when the director is starting up. To do this,
install/helm/space-agon/values.yaml
, replace theipAddress
field formmf
and themmfAddress
field fordirector
to be the IP address that you just reserved.install/helm/space-agon/values.yaml
, change theomCoreAddress
field ofdirector
to be the address of you OM2 service on Cloud Run.Now in the root directory of the demo and use
make build && make install
to start the Space Agon demo. NOTE: after you have the external IP address of thefrontend
service, open two chrome windows so you can see them AT THE SAME TIME, and clickFind Game
. If you can't see both tabs at the same time, the demo's client has a bug that will connect to a match several times.Towards #50